package com.nulldev.util.io;

import com.nulldev.util.JVM.Arguments;

public class IOUtilsInternals {
	public static final boolean USE_LARGE_MEMORY_ALLOC = Arguments.hasArgument("--IOUtils.useLargeMemAlloc");

	// ANDROID-TODO: Detect if we're a low memory device and have a lower preset.
	public static final int MEMORY_ALLOC_BUFFER = USE_LARGE_MEMORY_ALLOC ? 16384 : 8192;
	public static final int STRING_ALLOC_BUFFER = USE_LARGE_MEMORY_ALLOC ? 4096 : 1024;

	public static final boolean isWhitelistedForDMA() {
		/// XXX: Currently being reworked. Disabled until further notice.
//				if (IOUtilsOS.get() == OperatingSystem.Linux || IOUtilsOS.get() == OperatingSystem.BSD)
//					return true;
//				if (IOUtilsOS.isWindows()) {
//					try {
//						final IOUtilsOS.Windows_Type g = IOUtilsOS.Windows_Type.getType();
//						if (g.getNT() >= IOUtilsOS.Windows_Type.WINDOWS_XP_P64.getNT())
//							return true;
//					} catch (Exception e) {
//						JVM.errorln(e);
//					}
//				}
		return false;
	}
}
